package l.l.w.CodingInterviews;

/**
 * Created by llw on 2018/3/1.
 */
public class _04Problem {
    public boolean Find(int target, int [][] array) {
        if(array == null) return false;
        int m = array.length;
        int n = array[0].length;
        int i = 0, j = n-1;
        while(i < m && j >=0){
            if(array[i][j] == target) return true;
            if(array[i][j] < target) i++;
            else j--;
        }
        return false;
    }
}
